import axios from 'axios';

let base = '';


export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };

//获取所有部门列表
export const getDepList = params => { return axios.post(`${base}/dept`, params)};

//单删部门
export const removeDep = params => { return axios.delete(`${base}/dept/${params.id}`, { params: params }); };

//批量删除部门
export const batchRemoveDep = params => { return axios.delete(`${base}/dept/batchremove/${params}`, { params: params }); };

//添加或编辑
export const addDep = params => { return axios.put(`${base}/dept`,params)};

//查询所有员工
export const findEmployees = params => { return axios.get(`${base}/emp`)};

//部门树
export const DepTree = params => { return axios.get(`${base}/dept/tree`)}



//高查
export const getEmpList = params => { return axios.post(`${base}/emp`, params)};

export const removeEmp = params => { return axios.delete(`${base}/emp/${params.id}`, { params: params }); };

export const findDepts = params => { return axios.get(`${base}/dept`)};

export const addEmp = params => { return axios.put(`${base}/emp`,params)};

export const batchRemoveEmps = params => { return axios.patch(`${base}/emp`, params) };
